# -*- coding: utf-8 -*-
"""
Created on Wed Dec 20 10:27:19 2017

@author: Luther
"""

import os
import shutil

path_name = input("请输入文件名列表的位置：")
path = input("请输入待复制文件的目录：")
path_t = input("请输入目标文件夹：")

with open(path_name) as f:
    name = f.read()
name = name.split()

for i in range(len(name)):
    try:
        path_old = os.path.join(path, name[i])
        path_new = os.path.join(path_t, name[i])
        shutil.copy(path_old, path_new)
    except:
        print("文件{:}复制失败".format(name[i]))

print("复制成功！")
